﻿Imports Microsoft.VisualBasic.CompilerServices
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms

Namespace Stickam_Client
    <DesignerGenerated> _
    Public Class Form_JoinRoom
        Inherits Form
        ' Methods
        <DebuggerNonUserCode> _
        Public Sub New()
            Me.InitializeComponent
        End Sub

        <DebuggerNonUserCode> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try 
                If (disposing AndAlso (Not Me.components Is Nothing)) Then
                    Me.components.Dispose
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub

        Private Sub FormParent_RoomlistRetrieved(ByVal IsSuccess As Boolean)
            Dim total As Integer = Me.FormParent.Roomlist.total
            If (IsSuccess And (total > 0)) Then
                Dim num4 As Integer = (total - 1)
                Dim i As Integer = 0
                Do While (i <= num4)
                    Dim str As String = "[O]"
                    If ((Me.FormParent.Roomlist.ArrayRoomPrivate(i) = "true") Or (Me.FormParent.Roomlist.ArrayRoomProtected(i) = "true")) Then
                        str = "[X]"
                    End If
                    Me.Roomlist.Items.Add(String.Concat(New String() { str, "(", Me.FormParent.Roomlist.ArrayRoomPopulation(i), ") ", Me.FormParent.Roomlist.ArrayRoomName(i) }))
                    i += 1
                Loop
                Dim selectedIndex As Integer = Me.FormParent.Roomlist.selectedIndex
                If ((selectedIndex <> -1) And (selectedIndex < Me.Roomlist.Items.Count)) Then
                    Me.Roomlist.SelectedIndex = selectedIndex
                End If
            End If
            Me.RefreshList.Enabled = True
        End Sub

        <DebuggerStepThrough> _
        Private Sub InitializeComponent()
            Dim manager As New ComponentResourceManager(GetType(Form_JoinRoom))
            Me.Roomlist = New ListBox
            Me.JoinRoom = New Button
            Me.RefreshList = New Button
            Me.Label1 = New Label
            Me.RoomName = New TextBox
            Me.Label2 = New Label
            Me.RoomID = New TextBox
            Me.Label3 = New Label
            Me.RoomPass = New TextBox
            Me.SuspendLayout
            Me.Roomlist.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            Me.Roomlist.FormattingEnabled = True
            Me.Roomlist.ItemHeight = 12
            Dim point As New Point(1, 1)
            Me.Roomlist.Location = point
            Me.Roomlist.Name = "Roomlist"
            Dim size As New Size(140, &H94)
            Me.Roomlist.Size = size
            Me.Roomlist.TabIndex = 0
            Me.JoinRoom.Enabled = False
            Me.JoinRoom.FlatStyle = FlatStyle.Popup
            Me.JoinRoom.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H47, 150)
            Me.JoinRoom.Location = point
            Me.JoinRoom.Name = "JoinRoom"
            size = New Size(70, &H12)
            Me.JoinRoom.Size = size
            Me.JoinRoom.TabIndex = 1
            Me.JoinRoom.Text = "JOIN ROOM"
            Me.JoinRoom.UseCompatibleTextRendering = True
            Me.JoinRoom.UseVisualStyleBackColor = True
            Me.RefreshList.FlatStyle = FlatStyle.Popup
            Me.RefreshList.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(1, 150)
            Me.RefreshList.Location = point
            Me.RefreshList.Name = "RefreshList"
            size = New Size(&H45, &H12)
            Me.RefreshList.Size = size
            Me.RefreshList.TabIndex = 2
            Me.RefreshList.Text = "REFRESH"
            Me.RefreshList.UseCompatibleTextRendering = True
            Me.RefreshList.UseVisualStyleBackColor = True
            Me.Label1.AutoSize = True
            Me.Label1.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(-1, &HAC)
            Me.Label1.Location = point
            Me.Label1.Name = "Label1"
            size = New Size(&H21, 12)
            Me.Label1.Size = size
            Me.Label1.TabIndex = 3
            Me.Label1.Text = "Name:"
            Me.RoomName.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H1D, &HA9)
            Me.RoomName.Location = point
            Me.RoomName.Name = "RoomName"
            size = New Size(&H70, &H12)
            Me.RoomName.Size = size
            Me.RoomName.TabIndex = 4
            Me.Label2.AutoSize = True
            Me.Label2.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(-1, &HBF)
            Me.Label2.Location = point
            Me.Label2.Name = "Label2"
            size = New Size(&H12, 12)
            Me.Label2.Size = size
            Me.Label2.TabIndex = 5
            Me.Label2.Text = "ID:"
            Me.RoomID.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(14, &HBC)
            Me.RoomID.Location = point
            Me.RoomID.Name = "RoomID"
            size = New Size(&H26, &H12)
            Me.RoomID.Size = size
            Me.RoomID.TabIndex = 6
            Me.RoomID.Text = "804110"
            Me.Label3.AutoSize = True
            Me.Label3.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H34, &HBF)
            Me.Label3.Location = point
            Me.Label3.Name = "Label3"
            size = New Size(&H1D, 12)
            Me.Label3.Size = size
            Me.Label3.TabIndex = 7
            Me.Label3.Text = "Pass:"
            Me.RoomPass.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H4E, &HBC)
            Me.RoomPass.Location = point
            Me.RoomPass.Name = "RoomPass"
            size = New Size(&H3F, &H12)
            Me.RoomPass.Size = size
            Me.RoomPass.TabIndex = 8
            Dim ef As New SizeF(6!, 13!)
            Me.AutoScaleDimensions = ef
            Me.AutoScaleMode = AutoScaleMode.Font
            size = New Size(&H8E, &HCF)
            Me.ClientSize = size
            Me.Controls.Add(Me.RoomPass)
            Me.Controls.Add(Me.Label3)
            Me.Controls.Add(Me.RoomID)
            Me.Controls.Add(Me.Label2)
            Me.Controls.Add(Me.RoomName)
            Me.Controls.Add(Me.Label1)
            Me.Controls.Add(Me.RefreshList)
            Me.Controls.Add(Me.JoinRoom)
            Me.Controls.Add(Me.Roomlist)
            Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
            Me.Icon = DirectCast(manager.GetObject("$this.Icon"), Icon)
            Me.MaximizeBox = False
            Me.Name = "Form_JoinRoom"
            Me.StartPosition = FormStartPosition.Manual
            Me.Text = "Join A Room"
            Me.ResumeLayout(False)
            Me.PerformLayout
        End Sub

        Private Sub JoinRoom_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.FormParent.doJoin(Me.RoomID.Text, Me.RoomName.Text, Me.RoomPass.Text)
            Me.Close
        End Sub

        Private Sub RefreshList_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.RefreshList.Enabled = False
            Me.Roomlist.Items.Clear
            Me.FormParent.getRoomlist
        End Sub

        Private Sub Roomlist_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
            Dim selectedIndex As Integer = Me.Roomlist.SelectedIndex
            If (selectedIndex <> -1) Then
                Me.JoinRoom.Enabled = True
                Me.FormParent.Roomlist.selectedIndex = selectedIndex
                Me.RoomID.Text = Me.FormParent.Roomlist.ArrayRoomID(selectedIndex)
                Me.RoomName.Text = Me.FormParent.Roomlist.ArrayRoomName(selectedIndex)
            Else
                Me.JoinRoom.Enabled = False
            End If
        End Sub


        ' Properties
        Public Overridable Property FormParent As Form1
            <DebuggerNonUserCode> _
            Get
                Return Me._FormParent
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Form1)
                Dim handler As RoomlistRetrievedEventHandler = New RoomlistRetrievedEventHandler(AddressOf Me.FormParent_RoomlistRetrieved)
                If (Not Me._FormParent Is Nothing) Then
                    RemoveHandler Me._FormParent.RoomlistRetrieved, handler
                End If
                Me._FormParent = WithEventsValue
                If (Not Me._FormParent Is Nothing) Then
                    AddHandler Me._FormParent.RoomlistRetrieved, handler
                End If
            End Set
        End Property

        Friend Overridable Property JoinRoom As Button
            <DebuggerNonUserCode> _
            Get
                Return Me._JoinRoom
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.JoinRoom_Click)
                If (Not Me._JoinRoom Is Nothing) Then
                    RemoveHandler Me._JoinRoom.Click, handler
                End If
                Me._JoinRoom = WithEventsValue
                If (Not Me._JoinRoom Is Nothing) Then
                    AddHandler Me._JoinRoom.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property Label1 As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._Label1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._Label1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label2 As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._Label2
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._Label2 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label3 As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._Label3
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._Label3 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property RefreshList As Button
            <DebuggerNonUserCode> _
            Get
                Return Me._RefreshList
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.RefreshList_Click)
                If (Not Me._RefreshList Is Nothing) Then
                    RemoveHandler Me._RefreshList.Click, handler
                End If
                Me._RefreshList = WithEventsValue
                If (Not Me._RefreshList Is Nothing) Then
                    AddHandler Me._RefreshList.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property RoomID As TextBox
            <DebuggerNonUserCode> _
            Get
                Return Me._RoomID
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As TextBox)
                Me._RoomID = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Roomlist As ListBox
            <DebuggerNonUserCode> _
            Get
                Return Me._Roomlist
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As ListBox)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.Roomlist_SelectedIndexChanged)
                If (Not Me._Roomlist Is Nothing) Then
                    RemoveHandler Me._Roomlist.SelectedIndexChanged, handler
                End If
                Me._Roomlist = WithEventsValue
                If (Not Me._Roomlist Is Nothing) Then
                    AddHandler Me._Roomlist.SelectedIndexChanged, handler
                End If
            End Set
        End Property

        Friend Overridable Property RoomName As TextBox
            <DebuggerNonUserCode> _
            Get
                Return Me._RoomName
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As TextBox)
                Me._RoomName = WithEventsValue
            End Set
        End Property

        Friend Overridable Property RoomPass As TextBox
            <DebuggerNonUserCode> _
            Get
                Return Me._RoomPass
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As TextBox)
                Me._RoomPass = WithEventsValue
            End Set
        End Property


        ' Fields
        <AccessedThroughProperty("FormParent")> _
        Private _FormParent As Form1
        <AccessedThroughProperty("JoinRoom")> _
        Private _JoinRoom As Button
        <AccessedThroughProperty("Label1")> _
        Private _Label1 As Label
        <AccessedThroughProperty("Label2")> _
        Private _Label2 As Label
        <AccessedThroughProperty("Label3")> _
        Private _Label3 As Label
        <AccessedThroughProperty("RefreshList")> _
        Private _RefreshList As Button
        <AccessedThroughProperty("RoomID")> _
        Private _RoomID As TextBox
        <AccessedThroughProperty("Roomlist")> _
        Private _Roomlist As ListBox
        <AccessedThroughProperty("RoomName")> _
        Private _RoomName As TextBox
        <AccessedThroughProperty("RoomPass")> _
        Private _RoomPass As TextBox
        Private components As IContainer
    End Class
End Namespace

